-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(diff): avoid cache miss in server-side diff (#20423) #20424
fix(diff): avoid cache miss in server-side diff (#20423) #20424
Conversation
Signed-off-by: Michael Crenshaw <[email protected]>
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
@@ -1056,15 +1056,15 @@ func (a *ApplicationStatus) GetRevisions() []string { | |||
|
|||
// BuildComparedToStatus will build a ComparedTo object based on the current | |||
// Application state. | |||
func (app *Application) BuildComparedToStatus() ComparedTo { | |||
func (spec *ApplicationSpec) BuildComparedToStatus() ComparedTo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scoped this down since we don't need access to the whole app. Makes it easier to avoid doing a DeepCopy
on the whole app in specEqualsCompareTo
Signed-off-by: Michael Crenshaw <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #20424 +/- ##
==========================================
- Coverage 56.05% 55.07% -0.99%
==========================================
Files 322 322
Lines 44802 54927 +10125
==========================================
+ Hits 25115 30252 +5137
- Misses 17084 22077 +4993
+ Partials 2603 2598 -5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -947,6 +945,25 @@ func useDiffCache(noCache bool, manifestInfos []*apiclient.ManifestResponse, sou | |||
return true | |||
} | |||
|
|||
// specEqualsCompareTo compares the application spec to the comparedTo status. It normalizes the destination to match | |||
// the comparedTo destination before comparing. It does not mutate the original spec or comparedTo. | |||
func specEqualsCompareTo(spec v1alpha1.ApplicationSpec, comparedTo v1alpha1.ComparedTo) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be ptr arguments, but I dont think performance will increase that much.
func specEqualsCompareTo(spec v1alpha1.ApplicationSpec, comparedTo v1alpha1.ComparedTo) bool { | |
func specEqualsCompareTo(spec *v1alpha1.ApplicationSpec, comparedTo *v1alpha1.ComparedTo) bool { |
/cherry-pick release-2.13 |
/cherry-pick release-2.12 |
/cherry-pick release-2.10 |
/cherry-pick release-2.11 |
Cherry-pick failed with |
* fix(diff): avoid cache miss in server-side diff (#20423) Signed-off-by: Michael Crenshaw <[email protected]> * fix silly mistakes Signed-off-by: Michael Crenshaw <[email protected]> --------- Signed-off-by: Michael Crenshaw <[email protected]>
* fix(diff): avoid cache miss in server-side diff (#20423) Signed-off-by: Michael Crenshaw <[email protected]> * fix silly mistakes Signed-off-by: Michael Crenshaw <[email protected]> --------- Signed-off-by: Michael Crenshaw <[email protected]>
* fix(diff): avoid cache miss in server-side diff (#20423) Signed-off-by: Michael Crenshaw <[email protected]> * fix silly mistakes Signed-off-by: Michael Crenshaw <[email protected]> --------- Signed-off-by: Michael Crenshaw <[email protected]>
…0449) * fix(diff): avoid cache miss in server-side diff (#20423) * fix silly mistakes --------- Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Michael Crenshaw <[email protected]>
…0450) * fix(diff): avoid cache miss in server-side diff (#20423) * fix silly mistakes --------- Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Michael Crenshaw <[email protected]>
…0451) * fix(diff): avoid cache miss in server-side diff (#20423) * fix silly mistakes --------- Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Michael Crenshaw <[email protected]>
Fixes #20423